<?php

/**
 * @author hungnq@younetco.com
 */
class Tab_Form_Search extends YouNet_Form
{
	protected $_element_decorators = array(
		'ViewHelper',
		'Description',
		'Errors',
		array('HtmlTag', array('tag' => 'dd')),
		array('Label', array('tag' => 'dt')),
	);
	
	
	public function init()
	{
		$this->setMethod('post');

		$this->setAttrib('class','sm_form search');
		
		$this->addElement('text', 'keyword', array(
			'decorators' => array('ViewHelper'),
			'class' => 'search_textbox',
			'filters' => array(
				'StringTrim'
			)
		));

		$this->addElement('select','criteria', array(
			'decorators' => array('ViewHelper'),
		));
		
		$this->getElement('criteria')->setMultiOptions(
				array(
					Core_Model_IEntry::FILTER_BY_TITLE_DESC_VALUE	=> YouNet_Util::translate('LABEL_TITLE_DESC'),
					Core_Model_IEntry::FILTER_BY_REGISTRANT_VALUE	=> YouNet_Util::translate('LABEL_REGISTRANT'),
				)
		);
		
		
		$this->addElement('submit', 'btn_search', array(
			'label' => '',
			'class' => 'sm_button blue search_button',
			'decorators' => array('ViewHelper')
		));
	}

}
